<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="x" uri="/soar-bx-tags"%>
<x:HeaderParts />
<x:MainPartsTag>
	<x:zone name="MainZone">
		<x:Form action="org/users.shtml">
			<x:ParamsParts>
				<x:TextField name="id" type="hidden"></x:TextField>
			</x:ParamsParts>
			<x:TabParts activeIndex="0" tabs="[用户管理:'']"></x:TabParts>
			<x:SearchParts>
	用户名：<x:TextField name="searchMobile"></x:TextField>
	姓名：<x:TextField name="searchName"></x:TextField>
	<s:if test="issupadmin==\"supadmin\"">
	组织机构：<select name="searchOrgId" style="width:150px">
						<option value="">请选择</option>
						<s:iterator value="orgList">
							<option value="<s:property value='ID'/>"
								<s:if test="searchOrgId==ID">selected="selected"</s:if>>
								<s:property value="ORG_NAME" />
							</option>
						</s:iterator>
					</select>
					
	状态：<select name="searchStatus" style="width:90px">
						<option value="">请选择</option>
						<option value="0" <s:if test="searchStatus==\"0\"">selected="selected"</s:if>>
						禁用
						</option>
						<option value="1" <s:if test="searchStatus==\"1\"">selected="selected"</s:if>>
						正常
						</option>
		</select>	
		</s:if>		
			</x:SearchParts>
			<x:DataListParts>
				<thead>
					<tr>
						<td width="4%" align="center">序号</td>
						<td width="4%" align="center"><input type="checkbox" data-x="mult" data-target="ids"></td>
						<td width="8%" align="center" sort="T1.MOBILE">用户名</td>
						<td width="10%" align="center" sort="T1.NAME">姓名</td>
						<td width="12%">邮箱</td>
						<td width="15%" align="center">组织机构</td>
						<td width="10%" align="center" sort="T1.CREATE_DATE">注册日期</td>
						<td width="10%" align="center">所属角色</td>
						<td width="10%" align="center" sort="T1.STATUS">状态</td>
						<td width="10%" align="center">操作</td>
					</tr>
				</thead>
				<tbody>
					<s:iterator value="sysPageList">
						<tr>
							<td align="center"><s:property value="PAGE_ROW_NUM" />
							</td>
							<td align="center"><input type="checkbox" name="ids"
								value="<s:property value="ID"/>">
							</td>
							<td align="center"><s:property value="MOBILE" />
							</td>
							<td align="center"><s:property value="NAME" />
							</td>
							<td><s:property value="EMAIL" />
							</td>
							<td align="center"> <s:property value="ORG_NAME" /></td>
							<td align="center"><s:property value="CREATE_DATE" formatDate="true"/></td>
							<td align="center"><s:property value="rolemap[ID]" /></td>
						
							
								<s:if test="STATUS==\"1\"">
									<td align="center"><font color="blue">正常</font></td>
								</s:if>
								<s:elseif test="STATUS==\"0\"">
									<td align="center"><font color="red">禁用</font></td>
								</s:elseif>
								<s:elseif test="STATUS==\"2\"">
									<td align="center"><font color="">注册未完成</font></td>
								</s:elseif>
								<s:elseif test="STATUS==\"3\"">
									<td align="center"><font color="#4CC417">移除</font></td>
								</s:elseif>
								<s:else></s:else>
							<td align="center">
							<input type="button" value="编辑"	class="btn btn-info btn-xs" 	onclick="X.Modal('org/users!doShow.shtml?id=<s:property value="ID"/>&&userId=<s:property value="ID"/>','','','500px','358px','编辑用户')">
							<input type="button" value="角色" class="btn btn-warning btn-xs"	onclick="X.Modal('auth/userrole.shtml?userIds=<s:property value="ID"/>','','','550px','300px','分配角色')">
							</td>
						</tr>
					</s:iterator>
				</tbody>
			</x:DataListParts>
			
			<x:ButtonsParts>
			<x:Button value="新增" role="primary" size="sm" onclick="doNew()" />
			<x:Button value="角色" role="warning" size="sm" onclick="rolePl()" />
			</x:ButtonsParts>
			<x:JsParts fn="rolePl,doNew">
function rolePl()
{
	if(X.ChkSlt('ids'))
	{
		var ids="";
		$("input[name='ids']").each(function(){
			if(this.checked)
			{
				ids+=this.value+",";
			}
		});
		X.Modal('auth/userrole.shtml?userIds='+ids,'','','500px','400px','用户角色')
	}
}
function doNew(){
X.Modal('org/users!doNew.shtml','','','450px','280px','新增用户');
}

	
</x:JsParts>
		</x:Form>
	</x:zone>
</x:MainPartsTag>
